package router

import (
	"github.com/gin-gonic/gin"
	"sens-fix/handler"
)

func Init() *gin.Engine {
	r := gin.Default()
	r.POST("/login", handler.Login)

	r.POST("/userRoleAdd", handler.UserRoleAdd)
	r.POST("/roleNodeAdd", handler.RoleNodeAdd)

	r.GET("/userRoleList", handler.UserRoleList)
	r.GET("/roleNodeList", handler.RoleNodeList)

	r.GET("/userRole", handler.UserRole)
	r.GET("/roleNode", handler.RoleNode)

	r.GET("/userList", handler.UserList)
	r.GET("/userDetail", handler.UserDetail)

	//车辆
	r.POST("/carAdd", handler.CarAdd)
	r.POST("/carOrderAdd", handler.CarOrderAdd)

	r.GET("/carOrderList", handler.CarOrderList)
	r.GET("/carOrderDetail", handler.CarOrderDetail)

	//车辆信息
	r.POST("/bigCarAdd", handler.BigCarAdd)
	r.POST("/bigCarOrderAdd", handler.BigCarOrderAdd)
	r.POST("/bigCarTypeAdd", handler.BigCarTypeAdd)

	r.GET("/bigCarOrderList", handler.BigCarOrderList)
	r.GET("/bigCarOrderDetail", handler.BigCarOrderDetail)
	r.GET("/bigCarTypeDetail", handler.BigCarTypeDetail)
	r.GET("/bigCarTypeList", handler.BigCarTypeList)

	//车辆交易
	r.GET("/carContractList", handler.CarContractList)
	r.GET("/carContractDetail", handler.CarContractDetail)
	return r
}
